function request(url, success, fail) {
    setTimeout(() => {
        if (Math.random() > 0.5) {
            success()
        } else {
            fail()
        }
    }, 1000)
}
request('百度', () => {
    console.log('成功');
}, () => {
    console.log('失败');
})